﻿using UnityEditor;
using UnityEngine;

namespace EditorFrameWork
{
    public static class RectExtension_Editor
    {
        public static void DrawOutLine(this Rect rect, Color color)
        {
            Handles.color = color;
            //绘制方块
            Handles.DrawAAPolyLine(2,
                new Vector3(rect.x, rect.y, 0), //左上
                new Vector3(rect.x, rect.yMax, 0), //左下
                new Vector3(rect.xMax, rect.yMax, 0), //右下
                new Vector3(rect.xMax, rect.y, 0), //右上
                new Vector3(rect.x, rect.y, 0)); //左上
            Handles.color = Color.white;
        }
    }
}